<?php

namespace Database\Factories;

use App\Models\ESCluster;
use Illuminate\Database\Eloquent\Factories\Factory;

/**
 * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Alarm>
 */
class AlarmFactory extends Factory
{
    /**
     * Define the model's default state.
     *
     * @return array<string, mixed>
     */
    public function definition(): array
    {
        return [
            'name' =>  $this->faker->randomElement(['簇电压欠压','过流','漏电','模组温差过大',
                                                    '自身故障','单体欠压','单体低温','与BCMU通讯故障', 
                                                    '单体高温','单体过压','与PCS通讯故障']),
            'type' => $this->faker->randomElement(['电池', '箱体']),
            'level' => $this->faker->randomElement(['light', 'moderate','severe']),//'normal', 
            'e_s_cluster_id' =>  $this->faker->randomElement(ESCluster::all()->pluck('id')),
        ];
    }
}
